package smedi.ismedi.mobile.bff.controller.process;

import com.smedi.ismedi.inmail.api.dto.request.ProcessTaskListRequest;
import com.smedi.ismedi.inmail.api.dto.response.ProcessTaskResponse;
import com.smedi.ismedi.inmail.api.feign.RemoteProcessFeignApi;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @Author Jimmy
 * @Date 2021/6/3 17:11
 */
@Api(value = "流程管理", tags = {"流程管理"})
@RequestMapping(value = "/mobilebff/v1/process")
@RestController
@RequiredArgsConstructor
public class ProcessController {
    private final RemoteProcessFeignApi remoteProcessFeignApi;

    /**
     * 获取 历史流程任务 列表
     *
     * @param processTaskListRequest 历史流程任务 列表 请求
     * @return ResponseData<ProcessTaskResponse>
     */
    @ApiOperation(httpMethod = "POST", value = "获取 历史流程任务 列表")
    @PostMapping(value = "/process-task/list")
    ResponseData<List<ProcessTaskResponse>> getProcessTaskList(@Valid @RequestBody ProcessTaskListRequest processTaskListRequest) {
        return remoteProcessFeignApi.getProcessTaskList(processTaskListRequest);
    }
}
